#!/bin/bash

i=1
count=$(find . -maxdepth 1 -mindepth 1 -type d |wc -l);
while [ $i -le $count ]
do
  cd "test$i" 
  "./test.sh"
  
  if [ $? -ne 0 ]
  then
    break
  fi
  
  i=`expr $i + 1`
  cd ".."
done

echo "Done"
